home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 414_02 / portable / mvcur.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-17  |  1.5 KB  |  59 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3. #undef    mvcur
  4.  
  5. #ifdef PDCDEBUG
  6. char *rcsid_mvcur = "$Header: C:\CURSES\portable\RCS\mvcur.c 2.1 1993/06/18 20:20:19 MH Rel MH $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   mvcur()    - low-level cursor movement
  15.  
  16.   Ultrix 4.1 Description:
  17.      This function controls low-level cursor motion with optimization.
  18.  
  19.   PDCurses Description:
  20.      There is no optimization here since the PC has memory mapped
  21.      video and we support, under certain compilation options, direct
  22.      video writes.
  23.  
  24.   PDCurses Return Value:
  25.      The mvcur() function returns OK on success and ERR on error.
  26.  
  27.   PDCurses Errors:
  28.      If the new cursor position is outside the physical screen size,
  29.      an error occurs.
  30.  
  31.   Portability:
  32.      PDCurses    int mvcur(int oldrow,int oldcol,int newrow,int newcol);
  33.      BSD Curses    int mvcur(int oldrow,int oldcol,int newrow,int newcol);
  34.      SYS V Curses    int mvcur(int oldrow,int oldcol,int newrow,int newcol);
  35.  
  36. **man-end**********************************************************************/
  37.  
  38. int    mvcur(int oldrow, int oldcol, int newrow, int newcol)
  39. {
  40. #ifdef PDCDEBUG
  41.     if (trace_on) PDC_debug("mvcur() - called: oldrow %d oldcol %d newrow %d newcol %d\n",oldrow,oldcol,newrow,newcol);
  42. #endif
  43.  
  44. #ifdef    TC
  45. #  pragma argsused
  46. #endif
  47.     if ((newrow >= LINES)    ||
  48.         (newcol >= COLS)    ||
  49.         (newrow < 0)    ||
  50.         (newcol < 0))
  51.     {
  52.         return( ERR );
  53.     }
  54.     PDC_gotoxy( newrow, newcol );
  55.     _cursvar.cursrow = newrow;
  56.     _cursvar.curscol = newcol;
  57.     return( OK );
  58. }
  59.